package homewoek1月4号.demo3.d3;

import java.util.HashMap;
import java.util.Map;

public class Demo1 {
    public static void main(String[] args) {
        Map<String, String> map = jiexi("{'name':'张同学','age':20,'birthday':'1999-10-06'}");
        for (Map.Entry<String, String> s : map.entrySet()) {
            System.out.println(/*s.getKey()+"="+*/s.getValue());
        }
    }
    public static Map<String,String> jiexi(String s) {
        HashMap<String, String> map = new HashMap<>();
        s=s.replace("{","");
        s=s.replace("}","");
        s=s.replace("'","");
        s=s.replace(":",",");
        String[] arr = s.split(",");
        for (int i = 0; i < arr.length; i+=2) {
            map.put(arr[i],arr[i+1]);
        }
        return map;
    }
}
